﻿Imports DAO
Imports DTO

Public Class LopHocBUS
    'Lay Bang
    Public Function LayBang() As DataTable
        'Kiem tra Business Rule neu co
        Dim dt As DataTable
        Dim lhDAO As New LopHocDAO()
        dt = lhDAO.LayBang()
        Return dt
    End Function

    ' lay si so cua mot lop hoc
    Public Function LaySiSo(ByVal maLH As Integer) As Integer
        Dim kq As Integer
        Dim lhDAO As New LopHocDAO()
        kq = lhDAO.LaySiSo(maLH)
        Return kq
    End Function

    'lay MaLH
    Public Function LayMaLH(ByVal tenLH As String) As Integer
        Dim kq As Integer
        Dim lhDAO As New LopHocDAO
        kq = lhDAO.LayMaLH(tenLH)
        Return kq
    End Function

    'Lay DSLH trừ Lop moi
    Public Function LayDSLH() As DataTable
        Dim dt As DataTable
        Dim lhDAO As New LopHocDAO()
        dt = lhDAO.LayDSLH()
        Return dt
    End Function

    'lay DSLH theo tat ca cac khoi, manam
    Public Function LayLHTheoTCKhoi(ByVal nam As Integer) As DataTable
        Dim dt As New DataTable
        Dim lhDAO As New LopHocDAO
        dt = lhDAO.LayLHTheoTCKhoi(nam)
        Return dt
    End Function

    'lay LH theo Khoi, manam
    Public Function LayLHTheoKhoi(ByVal maKhoi As Integer, ByVal nam As Integer) As DataTable
        Dim dt As New DataTable
        Dim lhDAO As New LopHocDAO
        dt = lhDAO.LayLHTheoKhoi(maKhoi, nam)
        Return dt
    End Function

    'lay ma lop hoc cua mot khoi
    Public Function SoLH(ByVal maKhoi As Integer, ByVal nam As Integer) As DataTable
        Dim kq As DataTable
        Dim lhDAO As New LopHocDAO
        kq = lhDAO.SoLH(maKhoi, nam)
        Return kq
    End Function

    'lay ten Lh cua tat ca cac khoi, theo nam
    Public Function SoLH_TatCa(ByVal nam As Integer) As DataTable
        Dim kq As DataTable
        Dim lhDAO As New LopHocDAO
        kq = lhDAO.SoLH_TatCa(nam)
        Return kq
    End Function

    ' lay bang lop hoc theo ma khoi
    Public Function LayBangLopHocTheoMaKhoi(ByVal maKhoi As String) As DataTable
        Dim dt As DataTable
        Dim lhDAO As New LopHocDAO()
        dt = lhDAO.LayBangLopHocTheoMaKhoi(maKhoi)
        Return dt
    End Function

End Class
